home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / GraKa / Picasso96Develop / Examples / P96CheckBoards.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-03  |  2.7 KB  |  72 lines

  1. /***********************************************************************
  2. * This is example shows how to use p96GetRTGDataTagList and p96GetBoardDataTagList
  3. *
  4. * tabt (Sat Sep 12 23:06:28 1998)
  5. ***********************************************************************/
  6.  
  7. #include <proto/exec.h>
  8. #include <proto/dos.h>
  9. #include    <proto/graphics.h>
  10. #include <proto/picasso96.h>
  11.  
  12. #include <stdio.h>
  13.  
  14. struct Library *P96Base;
  15.  
  16. void main(int argc,char **argv)
  17. {
  18.     if(P96Base = OpenLibrary(P96NAME, 2)){
  19.         ULONG NumBoards;
  20.         
  21.         if(p96GetRTGDataTags(P96GRD_NumberOfBoards, &NumBoards, TAG_END) == 1){
  22.             int i;
  23.  
  24.             printf("Looking through all boards installed for Picasso96\n");
  25.             for(i = 0; i < NumBoards; i++){
  26.                 char *BoardName;
  27.                 ULONG RGBFormats, MemorySize, FreeMemory, LargestFreeMemory, MemoryClock, MoniSwitch;
  28.                 int clock;
  29.                 
  30.                 p96GetBoardDataTags(i,
  31.                         P96GBD_BoardName, (ULONG)&BoardName,
  32.                         P96GBD_RGBFormats, (ULONG)&RGBFormats,
  33.                         P96GBD_TotalMemory, (ULONG)&MemorySize,
  34.                         P96GBD_FreeMemory, (ULONG)&FreeMemory,
  35.                         P96GBD_LargestFreeMemory, (ULONG)&LargestFreeMemory,
  36.                         P96GBD_MemoryClock, (ULONG)&MemoryClock,
  37.                         P96GBD_MonitorSwitch, (ULONG)&MoniSwitch,
  38.                         TAG_END);
  39.                 printf("--------------------------------------------------\n");
  40.                 printf("Board %ld:      %s\n", i, BoardName);
  41.                 printf("Total size of memory:     %8ld\n", MemorySize);
  42.                 printf("Size of free memory:      %8ld\n", FreeMemory);
  43.                 printf("Largest free chunk:       %8ld\n", LargestFreeMemory);
  44.                 printf("Monitor switch:   %s\n", MoniSwitch ? "set" : "not set");
  45.  
  46.                 printf("\nThis board supports:\n");
  47.                 printf("\tfollowing rgb formats:\n");
  48.                 if(RGBFormats & RGBFF_NONE)        printf("\t\tPLANAR\n");
  49.                 if(RGBFormats & RGBFF_CLUT)        printf("\t\tCHUNKY\n");
  50.                 if(RGBFormats & RGBFF_R5G5B5)        printf("\t\tR5G5B5\n");
  51.                 if(RGBFormats & RGBFF_R5G5B5PC)    printf("\t\tR5G5B5PC\n");
  52.                 if(RGBFormats & RGBFF_B5G5R5PC)    printf("\t\tB5G5R5PC\n");
  53.                 if(RGBFormats & RGBFF_R5G6B5)        printf("\t\tR5G6B5\n");
  54.                 if(RGBFormats & RGBFF_R5G6B5PC)    printf("\t\tR5G6B5PC\n");
  55.                 if(RGBFormats & RGBFF_B5G6R5PC)    printf("\t\tB5G6R5PC\n");
  56.                 if(RGBFormats & RGBFF_R8G8B8)        printf("\t\tR8G8B8\n");
  57.                 if(RGBFormats & RGBFF_B8G8R8)        printf("\t\tB8G8R8\n");
  58.                 if(RGBFormats & RGBFF_A8R8G8B8)    printf("\t\tA8R8G8B8\n");
  59.                 if(RGBFormats & RGBFF_A8B8G8R8)    printf("\t\tA8B8G8R8\n");
  60.                 if(RGBFormats & RGBFF_R8G8B8A8)    printf("\t\tR8G8B8A8\n");
  61.                 if(RGBFormats & RGBFF_B8G8R8A8)    printf("\t\tB8G8R8A8\n");
  62.                 if(RGBFormats & RGBFF_Y4U2V2)        printf("\t\tY4U2V2\n");
  63.                 if(RGBFormats & RGBFF_Y4U1V1)        printf("\t\tY4U1V1\n");
  64.                 clock = (MemoryClock+50000)/100000;
  65.                 printf("\tmemory clock set to %ld.%1ld MHz,\n",clock/10,clock%10);
  66.             }
  67.         }
  68.     
  69.         CloseLibrary(P96Base);
  70.     }
  71. }
  72.